
package com.food.mall.dao;

import com.food.mall.entity.FoodMallGoods;
import com.food.mall.entity.StockNumDTO;
import com.food.mall.util.PageQueryUtil;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FoodMallGoodsMapper {
    int deleteByPrimaryKey(Long goodsId);

    int insert(FoodMallGoods record);

    int insertSelective(FoodMallGoods record);

    FoodMallGoods selectByPrimaryKey(Long goodsId);

    FoodMallGoods selectByCategoryIdAndName(@Param("goodsName") String goodsName, @Param("goodsCategoryId") Long goodsCategoryId);

    int updateByPrimaryKeySelective(FoodMallGoods record);

    int updateByPrimaryKeyWithBLOBs(FoodMallGoods record);

    int updateByPrimaryKey(FoodMallGoods record);

    List<FoodMallGoods> findFoodMallGoodsList(PageQueryUtil pageUtil);

    int getTotalFoodMallGoods(PageQueryUtil pageUtil);

    List<FoodMallGoods> selectByPrimaryKeys(List<Long> goodsIds);

    List<FoodMallGoods> findFoodMallGoodsListBySearch(PageQueryUtil pageUtil);

    int getTotalFoodMallGoodsBySearch(PageQueryUtil pageUtil);

    int batchInsert(@Param("foodMallGoodsList") List<FoodMallGoods> foodMallGoodsList);

    int updateStockNum(@Param("stockNumDTOS") List<StockNumDTO> stockNumDTOS);

    int recoverStockNum(@Param("stockNumDTOS") List<StockNumDTO> stockNumDTOS);

    int batchUpdateSellStatus(@Param("orderIds")Long[] orderIds,@Param("sellStatus") int sellStatus);

}